#include "stdafx.h"
#include "RageIncTable.h"

struct  RageIncTableReflectionRegister
{
	RageIncTableReflectionRegister()
	{
		REGISTER_REFLECTION_MEMBER(RageIncItem,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(RageIncItem,m_iAddRage,INVALID_ID).Editor_SetAsRaw();
		
		REGISTER_REFLECTION_MEMBER(HeroRageIncItem,m_iID,INVALID_ID).Editor_SetAsPrimaryKey();
		REGISTER_REFLECTION_MEMBER(HeroRageIncItem,m_iAddRage,INVALID_ID).Editor_SetAsRaw();

		GlobalClassManager::Instance().RegisterClass(RageIncItem::s_GetReflection(),eDefaultDef_RageInc);
		GlobalDefManager::Instance().RegisterDefManger(&RageIncTable::Instance());

		GlobalClassManager::Instance().RegisterClass(HeroRageIncItem::s_GetReflection(),eDefaultDef_HeroRageInc);
		GlobalDefManager::Instance().RegisterDefManger(&HeroRageIncTable::Instance());

	}
}___rageinctablereflectionregister;

void RageIncTable::OnArchieveReaded()
{
	__RageIncTable::OnArchieveReaded();
	for(uint32 ii=0;ii<101;ii++)
	{
		RageIncItem * pItem=LookupItem(ii);
		if(pItem==NULL)
		{
			m_vAddRages[ii]=0;
		}
		else
		{
			m_vAddRages[ii]=pItem->m_iAddRage;
		}
	}
	
}

void HeroRageIncTable::OnArchieveReaded()
{
	__HeroRageIncTable::OnArchieveReaded();
	for(uint32 ii=0;ii<101;ii++)
	{
		HeroRageIncItem * pItem=LookupItem(ii);
		if(pItem==NULL)
		{
			m_vAddRages[ii]=0;
		}
		else
		{
			m_vAddRages[ii]=pItem->m_iAddRage;
		}
	}

}
